﻿<UserControl x:Class="Northwind.UI.WPF.OrderWizardEmployeeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
             xmlns:local="clr-namespace:Northwind.UI.WPF"             
             mc:Ignorable="d" 
             d:DesignHeight="360" d:DesignWidth="650">
    <DockPanel>
        <Border DockPanel.Dock="Top" Padding="10" 
                Margin="6,6,6,0"
                CornerRadius="5"
                Background="{StaticResource mainBlueBrush}">
            <TextBlock Text="Enter Employee Information"
                    Foreground="White" FontWeight="Bold"
                    FontSize="16"
                    HorizontalAlignment="Center"  />
        </Border>
        <Grid Margin="5,3,5,10">            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.65*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0" Margin="4,7,4,0" Grid.Row="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <ListBox ItemsSource="{Binding Employees}"
                         SelectedValuePath="EmployeeID"
                         SelectedItem="{Binding SelectedEmployee}"                 
                         x:Name="lstBoxEmployees"
                         Grid.Row="0">  
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <ContentControl>
                                <TextBlock Text="{Binding FirstName}" />
                            </ContentControl>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <!--<ListBox.Resources>
                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        </Style>
                    </ListBox.Resources>-->
                </ListBox>
            </Grid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <GroupBox Header="Details" IsEnabled="False"
                          Grid.Row="0"
                          MinHeight="240"         
                          DataContext="{Binding SelectedEmployee}">
                    <Grid Margin="4">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="6" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <!--<RowDefinition Height="30" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="30" />
                        <RowDefinition Height="Auto" />-->
                        </Grid.RowDefinitions>
                        <Label Content="Title:"
                       HorizontalAlignment="Right" />
                        <TextBox Text="{Binding Title, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Column="2" />
                        <Label Content="First Name:"
                       Grid.Row="1"
                       HorizontalAlignment="Right" />
                        <TextBox Text="{Binding FirstName, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="1"
                         Grid.Column="2" />
                        <Label Content="Last Name:"
                       Grid.Row="2"
                       HorizontalAlignment="Right" />
                        <TextBox Text="{Binding LastName, 
                         UpdateSourceTrigger=PropertyChanged,
                         Mode=OneWay}"
                         Grid.Row="2"
                         Grid.Column="2" />
                    </Grid>
                </GroupBox>
                <DockPanel Grid.Row="1">
                    <Button Content="Back" Command="{Binding ShowPreviousWizardChild}" 
                            Width="50" HorizontalAlignment="Right" DockPanel.Dock="Left"
                            Margin="10,6,5,5" />
                    <Button Content="Next" Command="{Binding ShowNextWizardChild}" 
                            DockPanel.Dock="Right"
                            Width="50" HorizontalAlignment="Right" Margin="0,6,5,5" />
                </DockPanel>
            </Grid>
        </Grid>
    </DockPanel>
</UserControl>
